home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Bug in FW_CInterest? < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.8 KB  |  [TEXT/ttxt]

  1. Subject:     Bug in FW_CInterest?
  2. Sent:        6/25/96 9:08 AM
  3. Received:    6/25/96 9:18 AM
  4. From:        Henri Lamiraux, lamiraux@apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Came back with an error
  9.  
  10.  
  11. ------------------------------------------------------------------------
  12.  
  13. The operator == definition of FW_CInterest in FWIntere.cpp, is giving me
  14. problems. Seems it always returns TRUE. Perhaps the return condition does
  15. not get fully evaluated due to precedence. Surrounding the return 
  16. condition
  17. with parentheses may solve the problem.
  18.  
  19.  
  20. FW_Boolean FW_CInterest::operator==(const FW_CInterest& other) const
  21. {
  22.     return fNotifier == other.fNotifier && fMessage == other.fMessage;
  23. }
  24.  
  25.  
  26.     return (fNotifier == other.fNotifier && fMessage == other.fMessage);
  27.  
  28. This operator is used as part of a MatchProc (FW_InterestMatchProc) 
  29. testing
  30. whether a given FW_CInterst object is already in the Receiver's interest
  31. list.
  32.  
  33. I don't seem to be able to add more than one interest to the list of a
  34. particular class object I'm writing. Any idea how I can get around the bug
  35. easily?
  36.  
  37.  
  38. I also noticed the following comment in FW_MNotifier::Notify()
  39.    while (pair)
  40.    {
  41.       // Get the next pair before doing any action in case the object is
  42. destroyed
  43.       // in the middle (for instance: OK button closing a dialog)
  44.       // [LSD] Warning: still dangerous in case the notifier has more than
  45. 1 interest
  46.  
  47. This appears to be true. Have you worked out a solution?
  48.  
  49.  
  50. Arni
  51.  
  52.  
  53.  
  54. ........................................................................
  55.  Henri Lamiraux                                      lamiraux@apple.com
  56.  Apple Computer, Inc.                 OpenDoc(tm) Development Framework
  57. ........................................................................
  58.  
  59.